<?php
include("Mail.php");


function send_email_all($to, $subject, $message, $is_html = 1)
{

	$headers["From"]    = php5GetConfig('config_email');
	$headers["To"]      = $to;

	$recipients         = $to;
	$headers["Subject"] = $subject;
	if($is_html) {
		$headers["Content-type"] = "text/html; charset=UTF-8" . "\r\n";
	} else {
		$headers["Content-type"] = "text/plain; charset=UTF-8" . "\r\n";
	}
	$body = $message;
	
	$params["host"] = "interspire.smtp.com";
	$params["port"] = "25";
	$params["auth"] = true;
	$params["username"] = "sendmail@labrynthmedia.com";
	$params["password"] = "password";
	
	// Create the mail object using the Mail::factory method
	$mail_object = @Mail::factory("smtp", $params);
	
	$mail_object->send($recipients, $headers, $body);

}


function send_email_newsletter($to, $subject, $message, $is_html = 1, $campID = '')
{

	$headers["From"]    = php5GetConfig('config_email');
	$headers["To"]      = $to;
	if($campID) {
		$headers['X-Smtpcom-CPID'] =  $campID;
	}
	$recipients         = $to;
	$headers["Subject"] = $subject;
	if($is_html) {
		$headers["Content-type"] = "text/html; charset=UTF-8" . "\r\n";
	} else {
		$headers["Content-type"] = "text/plain; charset=UTF-8" . "\r\n";
	}
	$body = $message;
	
	$params["host"] = php5GetConfig('config_smtp_host');
	$params["port"] = php5GetConfig('config_smtp_port');
	$params["auth"] = true;
	$params["username"] = php5GetConfig('config_smtp_username');
	$params["password"] = php5GetConfig('config_smtp_password');;
	
	// Create the mail object using the Mail::factory method
	$mail_object = @Mail::factory("smtp", $params);
	
	$mail_object->send($recipients, $headers, $body);

}

?>





